<?php
/**
 * @package WordPress
 * @subpackage desire
 */
?>
<?php
global $desireoptions;
?>
<?php if(!have_posts()) : ?>
    <div id="post-0" class="post error404 not-found">
        <h2 class="entry-title"><?php _e('Entry not found','desire'); ?></h2>
        <div class="entry-content">
            <p><?php _e('Oops no entries found. Try using the search!','desire'); ?></p>
            <p><?php get_search_form(); ?></p>
        </div>
    </div>
<?php endif; ?>
<?php while(have_posts()) : the_post(); ?>    
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'desire' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
        <div class="entry-meta">
            <span class="entry-date"><a href="<?php the_permalink(); ?>"><?php /* translators: draft saved date format, see http://php.net/date */ the_time(__('M jS, Y', 'desire' )); ?></a></span>
            <span class="entry-comments"><?php comments_popup_link( __( 'Leave a comment', 'desire' ), __( '1 Comment', 'desire' ), __( '% Comments', 'desire' ) ); ?><?php edit_post_link( __( 'Edit', 'desire' ), '<span class="meta-sep">|</span><span class="edit-link">', '</span>' ); ?></span>
        </div>
        <?php if($desireoptions['show_category_front']): ?>
        <div class="entry-cat">
            <span class="entry-categories"><?php _e('Posted in: ','desire'); ?><?php echo get_the_category_list(', '); ?></span>
        </div>
        <?php endif; ?>
        <div class="entry-content">
            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(150,150)); ?></a>
            <?php $marg = 'style="margin-top:0;"'; if(trim(get_the_excerpt() != "")): $marg = 'style="margin-top:15px;"'; ?><p style="margin-top: 0;"><?php echo get_the_excerpt(); ?></p><?php endif; ?>
            <p <?php echo $marg; ?>><a href="<?php the_permalink(); ?>" class="more-link"><?php _e('Read more','desire'); ?></a></p>
        </div>
        <?php
            $tags_list = get_the_tag_list( '', ', ' );
            if (trim($tags_list) !="" and $desireoptions['show_tags_front']):
        ?>
        <div class="entry-tags"><span class="tag-links"><?php _e('Tagged in:','desire'); ?> <?php echo $tags_list; ?></span></div>
        <?php endif; ?> <!-- end of tag list if -->        
    </div>
<?php endwhile; ?>
<?php desire_get_pagination(); ?>